﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TemplateWeb.Helpers
{
    public enum EnumTypeOfParam
    {
        DEFAULT,
        QuanLy,
        TINTUC
    }

    public class GridPagerProperties
    {
        #region Infomarion using for paging

        public int PageSize { get; set; }
        public int RecordCount { get; set; }
        public int CurrentPageIndex { get; set; }
        public int RefPageIndex { get; set; }
        public int PageCount
        {
            get
            {
                return (RecordCount / PageSize) + ((RecordCount % PageSize == 0) ? 0 : 1);
            }
        }

        /// <summary>
        /// Using when paging on TinTuc
        /// </summary>
        public EnumTypeOfParam TypeOfParam { get; set; }
        public int TransferValue { get; set; }
        public string StrTransferValue { get; set; }

        #endregion

        #region Infomation of Action link

        /// <summary>
        /// Gets or Sets the Display for the link
        /// </summary>
        public virtual String LinkText { get; set; }

        /// <summary>
        /// Gets or Sets the ActionName.
        /// </summary>
        public virtual String ActionName { get; set; }

        /// <summary>
        /// Gets or Sets the Controller
        /// </summary>
        public virtual String Controller { get; set; }

        /// <summary>
        /// Gets or sets the ID of the DOM element to update by using the response from the server.
        /// </summary>
        public virtual String UpdateTargetId { get; set; }

        public GridPagerProperties()
        {
            TypeOfParam = EnumTypeOfParam.DEFAULT;
            TransferValue = 0;
        }
        #endregion
    }
}